﻿namespace Nomo.UnityCoreModule.Waiters
{
    /// <summary>
    /// 与等待器。
    /// </summary>
    public sealed class AndWaiter : BinaryWaiter
    {
        internal AndWaiter(Waiter waiter1, Waiter waiter2) : base(waiter1, waiter2) { }

        private protected override bool KeepWaiting
        {
            get
            {
                Waiter1.MoveNext();
                Waiter2.MoveNext();
                return !Waiter1.Completed || !Waiter2.Completed;
            }
        }
    }
}
